package org.xx.armory.swing.builders;

import static org.apache.commons.lang3.StringUtils.trimToEmpty;

public class ButtonModelBuilder
        extends ComponentModelBuilder<ButtonModel> {
    private String actionName;
    private boolean default_;

    public ButtonModelBuilder() {
        this.actionName = "";
    }

    public ButtonModelBuilder setActionName(
            String actionName
    ) {
        this.actionName = actionName;
        return this;
    }

    public ButtonModelBuilder setDefault(
            boolean default_
    ) {
        this.default_ = default_;
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public ButtonModel build() {
        return new ButtonModel(getLineInfo(), getName(), isVisible(), trimToEmpty(this.actionName), this.default_);
    }
}
